<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>//控制台查看
     function fs(score){
        let total = 0;
        for(let i = 0 ; i<score.length; i++){
            total += score[i]
        }
        return total
        document.write("\n\n\n\n"+total)
     }
     let student1 =[+prompt('学生1语文'),+prompt('数学'),+prompt('英语')]
     let student2 =[+prompt('学生2语文'),+prompt('数学'),+prompt('英语')]
     let student1total = fs(student1)
     let student2total = fs(student2)
     console.log("\n学生1总分\n"+student1total)
     console.log("\n学生2总分\n"+student2total)
    </script>
</body>
</html>